<?php

/**
 * @package inc
 * @author Sheeba T G <sheeba@davinc.info> 
 * @copyright Copyright &copy; 2009, davinci
 * @since 1.0 - Feb-04-2009
 * @version 1.1
 */
class Database {
	
	/**
	 * @access private
	 */
	private static $_instance = null;
	
	/**
	 * @access private
	 */
	private $_mdb2 = null;
	
	/**
	 * <p>Get the instance of this object</p>
	 * 
	 * @access public
	 * @return Object Return an instance of Database
	 */
	public static function getInstance() {
		if(self::$_instance == null) {
			self::$_instance = new Database();
		}
		
		return self::$_instance;
	}
	
	/**
	 * This method will return the connection string
	 * 
	 * @access public
	 * @global cfg Global configuration variables
	 * @return dsn string
	 */
	public final function connect() {
		global $cfg;
		
		// All database related configs here
       $dbtype 		= 'mysql';				//DATABASE TYPE
	   $dbhost 		= 'localhost';			//DATABASE SERVER LOCAL
	   $dbusername	= 'root';				//DATABASE USER NAME
	   $dbpassword	= '';					//DATABASE PASSWORD
	   $dbname		= 'autogator';			//DATABASE NAME
		
       $dsn = (string) $dbtype . '://' . $dbusername .':'. $dbpassword.'@' . $dbhost . '/' . $dbname;      

       /*$dbtype 		  = 'mysql';				                    //DATABASE TYPE
	   $dbhost 		  = 'p50mysql155.secureserver.net';			//DATABASE SERVER LOCAL
	   $dbusername	  = 'plazeit';				                    //DATABASE USER NAME
	   $dbpassword	  = 'Samsung09';					              //DATABASE PASSWORD
	   $dbname		  = 'plazeit';			                      //DATABASE NAME

		
	   $dsn = (string) $dbtype . '://' . $dbusername . ':' . $dbpassword . '@' . $dbhost . '/' . $dbname;*/
		
		return $dsn;		
	}
}
?>